// ScopedModelHelper.getModel  获取方法

import 'package:flutter/cupertino.dart';
import 'package:flutterapp/scoped_model/city.dart';
import 'package:scoped_model/scoped_model.dart';

class ScopedModelHelper {
  static T getModel<T extends Model>(BuildContext context) {
    return ScopedModel.of<T>(context, rebuildOnChange: true);
  }

  static String getAreaId(context) {
    return ScopedModelHelper.getModel<CityModel>(context)
        .city
        ?.id; //?? //如果没有id 没有就返回Config....自定义的4个城市
    //Config.availableCitys.first.id;
  }
}
